package xin.yangshuai.basic01.gof23.builder;

public class Main {

    public static void main(String[] args) {
        DatabaseSqlLombok databaseSqlLombok = DatabaseSqlLombok.builder().database("mysql").tableName("user").offset(0).pageSize(10).sql("select * from test_user limit 0,10").build();
        System.out.println(databaseSqlLombok);


        DatabaseSqlBuilder databaseSqlBuilder = new MySQLDatabaseSqlBuilder().tableName("test_user").offset(0).pageSize(10);
        DatabaseSqlDirector databaseSqlDirector = new DatabaseSqlDirector();

        databaseSqlDirector.setDatabaseSqlBuilder(databaseSqlBuilder);

        DatabaseSql databaseSql = databaseSqlDirector.build();

        System.out.println(databaseSql.getDatabase());
        System.out.println(databaseSql.getSql());
    }
}
